package com.wisezone.java1902.d12_conections;

import java.util.LinkedList;

public class MyQueue<E> {
	private LinkedList<E> lists = new LinkedList<E>();
	/**
	 * 入队
	 * @param item
	 */
	public void enQueue(E item) {
		lists.addLast(item);
	}
	
	/**
	 * 出队
	 */
	public E deQueue() {
		return lists.removeFirst();
	}
	
	/**
	 * 队列元素
	 */
	public int size() {
		return lists.size();
	}
	public static void main(String[] args) {
		MyQueue<String> queue = new MyQueue<String>();
		queue.enQueue("小明");
		queue.enQueue("张三");
		queue.enQueue("李四");
		
		int size = queue.size();
		
		for (int i = 0; i < size; i++) {
			String item = queue.deQueue();
			System.out.println("item :"+item);
		}
		
	
	}
}
